
function updateResult(obj, state){
	document.getElementById(obj).innerHTML = state;
}

function invoke(){
	var hostName = "com.google.chrome.demo";
	var port = chrome.runtime.connectNative(hostName);
	updateResult("result1", "invoke..");
}

function listener(){
	updateResult("result2", "listen");
}

document.addEventListener('DOMContentLoaded', function() {
  document.querySelector('#button1').addEventListener(
      'click', invoke);
});